﻿#include "systemsetting.h"
#include "ui_systemsetting.h"

SystemSetting::SystemSetting(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::SystemSetting)
{
    ui->setupUi(this);

    foreach ( const QSerialPortInfo &info, QSerialPortInfo::availablePorts() ) {
        //qDebug() << "serial port name: " << info.portName();
        //qDebug() << "serial port description: " << info.description();
        ui->cbx_port->addItem(info.portName());
    }

    this->serial_info.serial_name = ui->cbx_port->currentText();
    this->serial_info.serial_baud = (QSerialPort::BaudRate)ui->cbx_baud->currentText().toInt();
}

SystemSetting::~SystemSetting()
{
    delete ui;
}

SystemSetting::SERIAL_INFO SystemSetting::GetSerialInfo()
{
    return serial_info;
}



void SystemSetting::on_cbx_port_activated(int index)
{
    qDebug() << "on_cbx_port_activated:" << index;

}

